/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>CreateTime: 2006-4-6 </p>
 * @author pengz
 * @version 1.0
 */

package cn.agiledata.bank.myspace.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.*;

public class ModifyLoginPassForm extends ActionForm {
	public String pass, newPass, reNewPass;
	public String objectType;
	public String objectId;
	
	//pay表示支付密码修改，login表示登录密码修改
	public String modifyType;
	
	//密码重置标志，默认为0，不重置。（1表示重置，不用校验原密码，直接改为新密码）
    public int resetFlag = 0;
    
    //个人申请通过email重置登录/支付密码
    //企业admin申请通过email重置登录密码
    public String email;
    public String resetCode;

	public String getNewPass() {
		return newPass;
	}

	public void setNewPass(String newPass) {
		this.newPass = newPass;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public String getReNewPass() {
		return reNewPass;
	}

	public void setReNewPass(String reNewPass) {
		this.reNewPass = reNewPass;
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		ActionMessage amm = new ActionMessage("pass is whrong");

		if (newPass == null || newPass.length() == 0) {
			errors.add("mailerrors", amm);
			return errors;
		}
		if (reNewPass == null || reNewPass.length() == 0) {
			errors.add("mailerrors", amm);
			return errors;
		}
		if (!reNewPass.equals(newPass)) {
			errors.add("mailerrors", amm);
			return errors;
		}

		return null;

	}

	public String getModifyType() {
		return modifyType;
	}

	public void setModifyType(String modifyType) {
		this.modifyType = modifyType;
	}

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public String getObjectType() {
		return objectType;
	}

	public void setObjectType(String objectType) {
		this.objectType = objectType;
	}
	
	public int getResetFlag() {
		return this.resetFlag;
	}
	public void setResetFlag(int flag) {
		this.resetFlag = flag;
	}
	
	public String getEmail() {
		return this.email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	public String getResetCode() {
		return this.resetCode;
	}
	public void setResetCode(String code) {
		this.resetCode = code;
	}

}